﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;

namespace JukeboxParty
{
    public partial class VotingPage : PhoneApplicationPage
    {
        //
        // Properties
        //
        private List<Song> _nextSongs;
        public List<Song> NextSongs
        {
            get { return this._nextSongs; }
        }

        private List<Artist> _musicCollection;
        public List<Artist> MusicCollection
        {
            get { return this._musicCollection; }
        }

        private Song _currentSong;
        public Song CurrentSong
        {
            get { return this._currentSong; }
            set { this._currentSong = value; }
        }

        //
        // Constructor
        //
        public VotingPage()
        {
            InitializeComponent();

            this._nextSongs = new List<Song>();
            this.NextTrackItemsControl.ItemsSource = this._nextSongs;

            this._musicCollection = new List<Artist>();
            this.RequestTrackItemsControl.ItemsSource = this._musicCollection;

            Artist augustBurnsRed = new Artist("August Burns Red");
            Album rescueAndRestore = new Album("Rescue & Restore", augustBurnsRed);
            rescueAndRestore.AlbumArtPath = "Assets/RescueAndRestore.jpg";

            this._currentSong = new Song("Echoes", rescueAndRestore, 10);
            this.CurrentSongGrid.DataContext = this;

            this._nextSongs.Add(new Song("Provision", rescueAndRestore, 1));
            this._nextSongs.Add(new Song("Fault Line", rescueAndRestore, 7));
            this._nextSongs.Add(new Song("Creative Captivity", rescueAndRestore, 6));
            this._nextSongs.Add(new Song("Spirit Breaker", rescueAndRestore, 3));
            this._nextSongs.Add(new Song("Count It All as Lost", rescueAndRestore, 4));
            this._nextSongs.Add(new Song("Beauty in Tragedy", rescueAndRestore, 8));

            this._musicCollection.Add(augustBurnsRed);

            Album leveler = new Album("Leveler", augustBurnsRed);
            leveler.AlbumArtPath = "Assets/Leveler.jpg";
            leveler.AddSong("Empire", 1);
            leveler.AddSong("Internal Cannon", 2);
            leveler.AddSong("Cutting the Ties", 4);
            leveler.AddSong("Boys of Fall", 11);
            leveler.AddSong("Leveler", 12);

            Artist blessthefall = new Artist("blessthefall");
            this._musicCollection.Add(blessthefall);
            Album awakening = new Album("Awakening", blessthefall);
            awakening.AlbumArtPath = "Assets/Awakening.jpg";
            awakening.AddSong("Promised Ones", 2);
            awakening.AddSong("Bottomfeeder", 3);
            awakening.AddSong("40 Days...", 6);
            awakening.AddSong("Meet Me at the Gates", 12);
        }
    }
}